.text
	.extern generic_handler
	.extern syscall_table

.macro  sum from=0, to=5
int   $\from
.if     \to-\from
sum     "(\from+1)",\to
.endif
.endm

sum

.altmacro
.macro generate from, to
	.globl  asm_wrapper_&\from

asm_wrapper_&\from :
	pusha
	push $&\from
	call generic_handler
	add $4, %esp
	popa
	iret

.if \to-\from
	generate %(\from+1), \to
.endif
.endm

.globl asm_wrapper_128
asm_wrapper_128:
	push %edx
	push %ecx
	push %ebx
	add $-1, %eax
	shl $2, %eax
	movl syscall_table, %ebx
	add %eax, %ebx
	call *%ebx
	add $12, %esp
	iret

generate 0 100
generate 101 127
generate 129 200
generate 201 255
